package oj;

/**
 * @author 郝文雪
 * @date 2022/7/15 11:43
 * @Description 有序数组重复项的删除
 */
public class LC26 {
    public int removeDuplicates(int[] nums) {
        return process(nums,1);
    }
    private int process(int[] nums,int k){
        int idx=0;
        for(int x:nums){
            if(idx<k || nums[idx-k]!=x){
                nums[idx++]=x;
            }
        }
        return idx;
    }
}
